s = input().split()

T = [0 for i in range(0, 300)]

ans2 = 0
ans = ""
for i in s:
	ii = i.lower()
	if ii != "of" and ii != "the" and ii != "for" and ii != "and":
		ans = ans + i[0]
	for j in ii:
		if T[ord(j)] == 0:
			ans2 = ans2 + 1
		T[ord(j)] = 1
print(ans)
print(ans2)

